﻿using System;
using Microsoft.Xna.Framework;
using WindowsGame.Common.Static;

namespace WindowsGame.Common.Screens
{
	public abstract class BaseScreen
	{
		public Color BackgroundColor { get; protected set; }
		protected Vector2 BannerPosition { get; set; }
		protected UInt16 Timer { get; private set; }
		protected ScreenType CurrScreen { get; set; }
		protected ScreenType NextScreen { get; set; }

		public virtual void Initialize()
		{
			BackgroundColor = Color.Black;
		}

		public virtual void LoadContent()
		{
			ResetTimer();
		}

		public ScreenType Update(ScreenType screenType)
		{
			Boolean escape = MyGame.Manager.InputManager.Escape();
			if (escape)
			{
				return ScreenType.Exit;
			}

			return screenType;
		}

		public virtual void Draw()
		{
		}

		protected void UpdateTimer(GameTime gameTime)
		{
			Timer += (UInt16)gameTime.ElapsedGameTime.Milliseconds;
		}
		protected void ResetTimer()
		{
			ResetTimer(0);
		}
		protected void ResetTimer(UInt16 timer)
		{
			Timer = timer;
		}

	}
}